home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 001-100 / 001-025 / 014 / amiga3d / amigaprocedures.c < prev    next >
C/C++ Source or Header  |  1995-03-17  |  2KB  |  125 lines

  1. #include <exec/types.h>
  2. #include "threed.h"
  3.  
  4. /* #define PROCDEBUG */
  5.  
  6. universeprocedure(argc,argv)
  7. int argc;
  8. char *argv[];
  9. {
  10.     static int error;
  11.     static int count;
  12.     int i;
  13.  
  14. #ifdef PROCDEBUG
  15.     printf("universeprocedure: executing universeprocedure()...\n");
  16. #endif
  17.  
  18.     for(i=0; i<argc; i++)
  19.     {
  20.  
  21. #ifdef PROCDEBUG
  22.     printf("argv[%lx] = %lx\n",argc,argv[i]);
  23. #endif
  24.         ;
  25.     }
  26.  
  27.     switch(argc)
  28.     {
  29.    case 0 : error = TRUE;  /* no objectinfopointer */
  30.        return(error);
  31.    case 1 : error = FALSE; /* no subroutines to execute */
  32.        return(error);
  33.    case 2 : count++;
  34.        {
  35.            struct Objectinfo ** oipp;
  36.            int (**subp)();
  37.            int (*sub)();
  38.  
  39.            oipp = *argv;
  40.            subp = *(argv+1);
  41. #ifdef PROCDEBUG
  42.      printf("oipp = %lx; *oipp = %lx; **oipp = %lx\n",oipp,*oipp,**oipp);
  43.      printf("subp = %lx; *subp = %lx; **subp = %lx\n",subp,*subp,**subp);
  44. #endif
  45.        }
  46.        break; 
  47.    default: break;
  48.     }
  49.  
  50.     return(error);
  51. }
  52.  
  53. amigaprocedure(argc,argv)
  54. int argc;
  55. char *argv[];
  56. {
  57.     static int error;
  58.     static int count;
  59.     int i;
  60.  
  61. #ifdef PROCDEBUG
  62.     printf("amigaprocedure: executing amigaprocedure()...\n");
  63. #endif
  64.  
  65.     for(i=0; i<argc; i++)
  66.     {
  67.  
  68. #ifdef PROCDEBUG
  69.     printf("argv[%lx] = %lx\n",argc,argv[i]);
  70. #endif
  71.         ;
  72.     }
  73.  
  74.     switch(argc)
  75.     {
  76.    case 0 : error = TRUE;  /* no objectinfopointer */
  77.        return(error);
  78.    case 1 : error = FALSE; /* no subroutines to execute */
  79.        return(error);
  80.    case 2 : count++;
  81.        {
  82.            struct Objectinfo ** oipp;
  83.            int (**subp)();
  84.            int (*sub)();
  85.  
  86.            oipp = *argv;
  87.            subp = *(argv+1);
  88. #ifdef PROCDEBUG
  89.      printf("oipp = %lx; *oipp = %lx; **oipp = %lx\n",oipp,*oipp,**oipp);
  90.      printf("subp = %lx; *subp = %lx; **subp = %lx\n",subp,*subp,**subp);
  91. #endif
  92.  
  93.            /* transpose objectmatrix */
  94.  
  95.            sub = *(subp+TRANSPOSE);
  96.  
  97.            (*sub)( (*oipp)->objectmatrix);
  98.  
  99.            /* yaw objectmatrix */
  100.            
  101.            sub = *(subp+YAW);
  102.  
  103.            (*sub)( (*oipp)->objectmatrix, SINA, COSA);
  104.  
  105.            /* pitch objectmatrix */
  106.  
  107.            sub = *(subp+PITCH);
  108.  
  109.            (*sub)( (*oipp)->objectmatrix, -SINB, COSB);
  110.  
  111.            /* transpose objectmatrix */
  112.  
  113.            sub = *(subp+TRANSPOSE);
  114.  
  115.            (*sub)( (*oipp)->objectmatrix);
  116.            
  117.        }
  118.        break; 
  119.    default: break;
  120.     }
  121.  
  122.     return(error);
  123. }
  124.  
  125.